﻿@using www.Controllers
@using www.SService
@{
    ViewBag.Title = "Danh mục";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

@Html.ActionLink("Thêm mới", "Add", "Category")
<div class="clear"></div>
<div class="content">
    <div class="col-left">Thể loại</div>
    <div class="col-right">
         @if (ViewData["Type"] != null)
         {
             using (@Html.BeginForm("Index", "Category", FormMethod.Post, new {id = "frmad"}))
             {
                 @Html.DropDownList("Type", null, new {onchange = "frmad.submit();",@class = "combobox"})
             }
         }     
    </div>
</div>

<fieldset>
    <legend>Danh sách danh mục</legend>
    <div class="clear"></div>
    <table style="width: 100%; height: auto; border: 1px solid #008080;" cellpadding="1" cellspacing="1">
        @if (ViewData["Data"] != null)
        {
            <tr style="background: #0000cd; color: #fff; height: 30px; font-size: 13px; font-weight: bold;text-align: center;">
                <th style="width: 30%;">Tên nhóm</th>
                <th style="width: 30%;">Từ khóa</th>
                <th style="width: 33%;">Mô tả</th>
                <th style="width: 7%;">Thao tác</th>
            </tr>
            foreach (var item in (List<RelaxCategoryDataContract>)ViewData["Data"])
            {
            <tr style="height: 25px;">
                <td>@item.Name</td>
                <td>@item.Keyword</td>
                <td>@item.Decription</td>
                <td>@Html.ActionLink("Sửa","Edit",new{id=item.Id}) | @Html.ActionLink("Xóa","Delete",new{id=item.Id},new {onclick="return confirmDelete();"})</td>
            </tr>
            }

        }
    </table>
</fieldset>
